package com.springboot.mail.modules.User.domain.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;

/**
 * @Description
 * @Author LY L
 * @Date 2024-11-06
 */
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Validated     // springboot 2.5.* 版本需要在类上标注 @Validated 注解校验注解才会生效。
public class UpdateEmailVO {


    @NotBlank(message = "请输入旧邮箱")
    @Email(message = "旧邮箱格式不正确")
    String oldEmail;

    @NotBlank(message = "请输入验证码")
    String oldCode;

    @NotBlank(message = "请输入新邮箱")
    @Email(message = "新邮箱格式不正确")
    String newEmail;

    @NotBlank(message = "请输入验证码")
    String newCode;
}
